﻿<Page x:Class="ControlDemos.ColorPickerPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:p="clr-namespace:PropertyTools.Wpf;assembly=PropertyTools.Wpf" mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="ColorPickerPage">
    <Page.Resources>
        <p:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
        <p:ColorToStringConverter x:Key="ColorToStringConverter"/>
    </Page.Resources>
    <StackPanel Width="250" VerticalAlignment="Center">
        <p:ColorPicker SelectedColor="{Binding Color1}" IsEnabled="{Binding IsChecked, ElementName=Enabled}" Margin="4"/>
        <p:ColorPicker SelectedColor="{Binding Color2}" IsEnabled="{Binding IsChecked, ElementName=Enabled}" Margin="4"/>
        <p:ColorPicker SelectedColor="{Binding Color3}" IsEnabled="{Binding IsChecked, ElementName=Enabled}" Margin="4"/>
        <p:ColorPicker SelectedColor="{Binding Color4}" IsEnabled="{Binding IsChecked, ElementName=Enabled}" Margin="4"/>
        <p:ColorPicker SelectedColor="{Binding Brush, Converter={StaticResource ColorToBrushConverter}}" IsEnabled="{Binding IsChecked, ElementName=Enabled}" Margin="4"/>
        <CheckBox x:Name="Enabled" Content="IsEnabled" IsChecked="True" Margin="10"/>
        <TextBox Text="{Binding Color1, Converter={StaticResource ColorToStringConverter}, UpdateSourceTrigger=PropertyChanged}" Width="160"/>
        <TextBox Text="{Binding Color1}" Width="160"/>
        <TextBox Text="{Binding Color2}" Width="160"/>
        <TextBox Text="{Binding Color3}" Width="160"/>
        <TextBox Text="{Binding Color4}" Width="160"/>
        <TextBox Text="{Binding Brush}" Width="160"/>
    </StackPanel>
</Page>
